﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BLL;
using System.Data;
using System.IO;
using System.Web.Script.Serialization;
using System.Configuration;


namespace website.MFG
{
    /// <summary>
    /// MFG 的摘要说明
    /// </summary>
    public class MFG : IHttpHandler
    {
        string Action = "";
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Action = RequstString("Action");

            if (Action == "getCustomInfoByID")
            {
                context.Response.Write(getCustomInfoByID());
            }

            else if (Action == "getEquNoListByID")
            {
                context.Response.Write(getEquNoListByID());
            }

            else if (Action == "shengchancusha")
            {
                context.Response.Write(shengchancusha());
            }
            else if (Action == "shengchancushadangqianfangsha")
            {
                context.Response.Write(shengchancushadangqianfangsha());
            }
            else if (Action == "getguidaoshengchanByID")
            {
                context.Response.Write(getguidaoshengchanByID());
            }
        }



        public string getCustomInfoByID()
        {
            string ID = RequstString("ID");
            string json = MFGBLL.getCustomInfoByID(ID);
            return json;
        }

        public string getEquNoListByID()
        {
            string ID = RequstString("ID");
            string json = MFGBLL.getEquNoListByID(ID);
            return json;
        }
        public string shengchancusha()
        {
            string EquNo = RequstString("EquNo");
            string json = MFGBLL.shengchancusha(EquNo);
            return json;
        }

        public string shengchancushadangqianfangsha()
        {
            string EquNo = RequstString("EquNo");
            string json = MFGBLL.shengchancushadangqianfangsha(EquNo);
            return json;
        }
        public string getguidaoshengchanByID()
        {
            string ID = RequstString("ID");
            string json = MFGBLL.getguidaoshengchanByID(ID);
            return json;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        public static string RequstString(string sParam)
        {
            return (HttpContext.Current.Request[sParam] == null ? string.Empty
                  : HttpContext.Current.Request[sParam].ToString().Trim());
        }
    }
}